<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>公开公告信息管理</title>
	<script src="../../js/header.js"></script>
	<style type="text/css">
		html, body, #gonggao {
			padding: 0px;
			margin: 0px;
		}
		#gonggao{
			border-top: 3px solid #0D9AFF;
			/*background: #FFFFFF;
			box-shadow: 0px 2px 4px 0 rgba(200,200,200,0.50);*/
			padding: 25px;
			/*background: url(../../images/bg.png) no-repeat;
			background-size: 100% 100%;
			background-attachment: fixed;*/
			/*overflow: hidden;*/
		}
		.tab-title{
			font-size: 16px;
			font-weight: bold;
			border-left: 4px solid #0D9AFF;
			font-family: PingFangSC-Medium;
			padding-left:10px;
			margin-bottom: 20px;
		}
		.el-dialog__footer {
			padding: 10px 20px 20px;
			text-align: center;
			-webkit-box-sizing: border-box;
			box-sizing: border-box;
		}
		.el-dialog__body {
			color: rgb(96, 98, 102);
			font-size: 14px;
			word-break: break-all;
			padding: 0px 20px;
		}
		#excel {
			display: none;
		}
		.el-input__inner {
			-webkit-appearance: none;
			background-color: #FFF;
			background-image: none;
			border-radius: 4px;
			border: 1px solid #DCDFE6;
			-webkit-box-sizing: border-box;
			box-sizing: border-box;
			color: #606266;
			display: inline-block;
			font-size: inherit;
			height: 30px;
			line-height: 30px;
			outline: 0;
			padding: 0 15px;
			-webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
			transition: border-color .2s cubic-bezier(.645,.045,.355,1);
		}
		/*#gonggao .el-input,
		#gonggao .el-select,
		#gonggao .el-input-number{
			width: 100%;
		}*/
		.listed .el-form-item__label{
			letter-spacing: 3px;
		}
		/*.el-textarea {
			width: 95%;
		}*/

		/* 搜索按钮样式修改 */
		#gonggao .el-button.is-circle.search_btn{
			position: absolute;
			right: 0;
			top: 0;
			border: 0;
			background: none;
		}
		#gonggao .el-button.is-circle.search_btn i{
			font-size: 17px;
		}

		.expertcredit_gonggao .el-form-item__content,
		.companycredit_gonggao .el-form-item__content{
			margin-left: 0!important;
		}
		.expertcredit_publicstate .el-select,
		.companycredit_publicstate .el-select{
			width: auto;
		}

		/* 拟制公告---封装样式 */
		.content_tab{
			padding: 20px 0;
		}
		.border_btm{
			border-bottom: 1px solid #ddd;
		}
		.border_right{
			border-right: 1px solid #ddd;
		}

		.index_dialog .el-dialog{
			background: url(../../images/bg.png) no-repeat;
			background-color: #fff;
			background-size: cover;
		}
	</style>
</head>

<body>
<div v-cloak id="gonggao">
	<div style="margin-top: 10px;">
		<div style="margin-top: 10px;border-bottom:1px solid rgba(200,200,200,0.43);">
			<el-form :model="selectForm" :rules="rules" ref="selectForm" label-width="150px">
				<el-row>
					<el-col :span="7">
						<el-form-item label="标题:" prop="" label-width="120px">
							<el-input v-model="selectForm.title" placeholder=""  style="width:300px"></el-input>
						</el-form-item>
					</el-col>
					<el-col span="7">
						<el-form-item label="创建人:" prop="" label-width="120px">
							<el-input v-model="selectForm.createUser" placeholder="" style="width:300px"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<!--<el-col :span="6">
						<el-form-item label="录入时间:" prop="" label-width="160px">
							<el-date-picker
								v-model="selectForm.inputenTime"
								type="date"
								value-format="yyyy-MM-dd HH:mm"
								placeholder="选择录入时间">
							</el-date-picker>
						</el-form-item>
					</el-col>-->
					<el-col :span="7">
						<el-form-item label="公开地址类型:" prop="" label-width="120px">
							<el-select v-model="selectForm.publicType" placeholder="请选择公开地址类型" style="width:300px">
								<el-option label="服务门户" value="0"></el-option>
								<el-option label="工作门户" value="1"></el-option>
								<el-option label="服务门户和工作门户" value="2"></el-option>
							</el-select>
						</el-form-item>
					</el-col>
					<el-col :span="7">
						<el-form-item label="公开状态:" prop="" label-width="120px">
							<el-select v-model="selectForm.publicState" placeholder="请选择公开状态" style="width:300px">
								<el-option label="不公开" value="0"></el-option>
								<el-option label="公开" value="1"></el-option>
							</el-select>
						</el-form-item>
					</el-col>
					<div style="float: right;">
						<el-button type="primary" size="small" style="width: 60px;height: 30px;" @click="apply()">申请</el-button>
						<el-button type="primary" size="small" style="width: 60px;height: 30px;" @click="searchForm()">查询</el-button>
						<el-button type="warning" size="small" style="width: 60px;height: 30px;" @click="resetForm('selectForm')">重置</el-button>
					</div>
				</el-row>
			</el-form>
		</div>

		<el-table :data="tableData" border style="width: 100%;margin-top: 35px;" :header-cell-style="{background:'#eef1f6',color:'#606266'}">
			<!--<el-table-column type="selection" ></el-table-column>-->
			<el-table-column
					prop="title"
					label="标题"
					width="250"
					:show-overflow-tooltip="true"
					align="center" >
			</el-table-column>
			<el-table-column
					prop="createUser"
					label="创建人"
					width="120"
					align="center">
			</el-table-column>
			<el-table-column
					prop="inputenTime"
					label="拟制时间"
					width="100"
					align="center">
			</el-table-column>
			<el-table-column
					prop="publishTime"
					label="发布时间"
					width="140"
					align="center">
			</el-table-column>
			<el-table-column
					prop="isPublic"
					label="公布类别"
					width="140"
					align="center">
				<template scope="scope">
					<span v-if="scope.row.isPublic==0">公示通报</span>
					<span v-if="scope.row.isPublic==1">标准规范</span>
				</template>
			</el-table-column>
			<el-table-column
					prop="publicType"
					label="公开地址类型"
					width="140"
					align="center">
					<template scope="scope">
						<span v-if="scope.row.publicType==0">服务门户</span>
						<span v-if="scope.row.publicType==1">工作门户</span>
						<span v-if="scope.row.publicType==2">服务门户和工作门户</span>
					</template>
			</el-table-column>
			<el-table-column
					prop="publicState"
					label="公开状态"
					width="120"
					align="center">
					<template scope="scope">
						<span v-if="scope.row.publicState==0" style="color:#53b4ff;">不公开</span>
						<span v-if="scope.row.publicState==1" style="color: #67C23A;">公开</span>
					</template>
			</el-table-column>
			<el-table-column
					prop="revokeg"
					label="撤销状态"
					width="120"
					align="center">
				<template scope="scope">
					<span v-if="scope.row.revokeg==0" style="color:#53b4ff;">未撤销</span>
					<span v-if="scope.row.revokeg==1" style="color: #67C23A;">已撤销</span>
				</template>
			</el-table-column>
			<el-table-column
					prop="publishType"
					label="审批状态"
					width="120"
					align="center">
				<template scope="scope">
					<span v-if="scope.row.publishType==0" style="color:#FF4949;">未通过</span>
					<span v-if="scope.row.publishType==1" style="color: #67C23A;">通过</span>
					<span v-if="scope.row.publishType == null" style="color: #53b4ff;">待审批</span>
				</template>
			</el-table-column>
			<el-table-column
					label="操作"
					width=""
					align="center">
				<template slot-scope="scope">
					<el-button type="" size="mini" @click="view(scope.$index,scope.row);showApprovalBtn=false;">查看</el-button>
					<el-button type="primary" size="mini" v-show="scope.row.publishType != 1" @click="edit(scope.$index,scope.row)">修改</el-button>
					<!-- 审批 -->
					<el-button type="warning" v-if="scope.row.publishType == null && hasApprovalBtn" size="mini" @click="view(scope.$index,scope.row);showApprovalBtn=true;">审批</el-button>
					<el-button type="warning" v-if="(scope.row.publishType == 1 || scope.row.publishType == 0) && hasApprovalBtn" size="mini" @click="view(scope.$index,scope.row);showApprovalBtn=true;" disabled>审批</el-button>

					<!-- 撤销 -->
					<el-button v-if="scope.row.publicState==1 && scope.row.revokeg==0 && scope.row.publishType != 1" type="success" size="mini" @click="revoke(scope.$index,scope.row)">撤销</el-button>
					<el-button v-else type="success" size="mini" @click="revoke(scope.$index,scope.row)" disabled>撤销</el-button>

					<el-button type="danger" size="mini" v-show="scope.row.publishType != 1" @click="del(scope.$index,scope.row)">删除</el-button>
				</template>
			</el-table-column>
		</el-table>
		<div style="overflow: hidden;">
			<div class="pagination">
				<el-pagination
						@size-change="handleSizeChange"
						@current-change="handleCurrentChange"
						:current-page="currentPage"
						:page-sizes="[10, 20, 30, 40]"
						:page-size="pagesize"
						background
						layout="total, sizes,prev, pager, next"
						:total="tableTotal"
						prev-text="上一页"
						next-text="下一页">
				</el-pagination>
			</div>
		</div>
        <!-- 添加、修改公告-公开公告 -->
		<el-dialog title="" :visible.sync="dialogForm" center fullscreen>
			<div style="margin-top: 10px;">
				<el-form :model="gonggao" :rules="rules" ref="gonggao" label-width="140px">
					<!--公开公告信息表-->
					<el-row>
						<el-col :span="4" class="tab-title">
							公开公告信息表
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="20">
							<el-form-item label="标题:" prop="title" label-width="120px">
								<el-input v-model="gonggao.title"  placeholder="" maxlength="500" show-word-limit></el-input>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="20">
							<el-form-item label="发文字号:" prop="releaseNumber" label-width="120px">
								<el-input v-model="gonggao.releaseNumber" placeholder="" maxlength="500" show-word-limit></el-input>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="8">
							<el-form-item label="公布类别:" prop="isPublic" label-width="120px">
								<el-radio-group v-model="gonggao.isPublic" style="width: 400px;">
									<el-radio label="0">公示通报</el-radio>
									<el-radio label="1">标准规范</el-radio>
								</el-radio-group>
							</el-form-item>
						</el-col>
						<el-col :span="8">
							<el-form-item label="法律法规类别:" prop="lawsType" label-width="120px">
								<el-input v-model="gonggao.lawsType"  placeholder="" maxlength="50" show-word-limit></el-input>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="8">
							<el-form-item label="公开地址类型:" prop="publicType" label-width="120px">
								<el-select v-model="gonggao.publicType"  placeholder="请选择公开地址类型" style="width: 400px;">
									<el-option label="服务门户" value="0"></el-option>
									<el-option label="工作门户" value="1"></el-option>
									<el-option label="服务门户和工作门户" value="2"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="8">
							<el-form-item label="公开状态:" prop="publicState" label-width="120px">
								<el-select v-model="gonggao.publicState"  placeholder="请选择公开状态" style="width: 400px;">
									<el-option label="不公开" value="0"></el-option>
									<el-option label="公开" value="1"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="8">
							<el-form-item label="施行日期:" prop="dateImplementation" label-width="120px">
								<el-date-picker type="date" v-model="gonggao.dateImplementation"  placeholder="请选择施行日期">
								</el-date-picker>
							</el-form-item>
						</el-col>
						<el-col :span="8">
							<el-form-item label="关键字:" prop="keyword" label-width="120px">
								<el-input v-model="gonggao.keyword" placeholder="" maxlength="50" show-word-limit></el-input>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="20">
							<el-form-item label="内容:" prop="attachContent" label-width="120px">
								<el-input
									type="textarea"
									:autosize="{ minRows: 8, maxRows: 8}"
									placeholder="请输入内容"
									maxlength="1000"
									show-word-limit
									v-model="gonggao.attachContent">
								</el-input>
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
				<el-form>
					<el-row>
						<el-col :span="24">
							<el-form-item label="附件:" prop="enclosure" label-width="120px" style="font-size: 18px;">
								<iframe id="viewFrame" style="overflow:hidden;height:200px;width:80%;" frameBorder="0"
										:src="link"></iframe>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col>
							<div style="float:right;">
								<el-button v-show="showOnSubmit" type="primary" size="small" style="width: 60px;height: 30px;" @click="onSubmit()">提交</el-button>
								<el-button v-show="showOnReplace" type="primary" size="small" style="width: 60px;height: 30px;" @click="onReplace()">修改</el-button>
								<el-button type="info" size="small" style="width: 60px;height: 30px;" @click="dialogForm = false;clearForm()">取消</el-button>
							</div>
						</el-col>
					</el-row>
				</el-form>
			</div>
		</el-dialog>

		<!-- 查看审批意见 -->
		<el-dialog title="" :visible.sync="dialogViewForm" class="index_dialog" center fullscreen>
			<el-row v-show="showApprovalBtn">
				<el-col :span="10" :offset="2">
					<el-button type="warning" size="mini" @click="dialogApprovalForm=true;">审批</el-button>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="16" :offset="4">
					<el-form :model="gonggao" :rules="rules" ref="gonggao">
						<!--公开公告信息表-->
						<el-row style="margin-bottom: 10px;">
							<el-col>
								<h4 style="margin-top: 10px;font-size: 40px;text-align: center;">{{ gonggao.title }}</h4>
							</el-col>
						</el-row>
						<el-row style="margin-bottom: 10px;padding-bottom: 10px;font-size: 24px;border-bottom: 1px solid #ddd;text-align: center;">
							<el-col :span="5">
								<span>{{ gonggao.createUser }}</span>
							</el-col>
							<el-col span="4">
								<span>{{ gonggao.inputenTime }}</span>
							</el-col>
							<el-col :span="6">
								<div style="float:right;">
									<span v-if="(gonggao.publicType == 0) ? true : false">服务门户</span>
									<span v-if="(gonggao.publicType == 1) ? true : false">工作门户</span>
									<span v-if="(gonggao.publicType == 2) ? true : false">服务门户和工作门户</span>
								</div>
							</el-col>
							<el-col :span="4">
								<div style="float:right;">
									<span v-if="(gonggao.publicState == 0) ? true : false">未公开</span>
									<span v-if="(gonggao.publicState != 0) ? true : false">公开</span>
								</div>
							</el-col>
                            <el-col :span="5">
                                <div style="float:right;">
                                    <span v-if="(gonggao.isPublic == 0) ? true : false">公示通报</span>
                                    <span v-if="(gonggao.isPublic == 1) ? true : false">标准规范</span>
                                </div>
                            </el-col>
						</el-row>
						<el-row style="padding: 0 20px;font-size: 24px;">
							<el-col>
								<!--<pre><span>{{ gonggao.attachContent }}</span></pre>-->
								<span v-html="gonggao.attachContent"></span>
							</el-col>
						</el-row>
						<el-row v-if="approvalShi.publishMsg != '' && approvalShi.publishMsg != null" style="margin: 20px 0;padding: 0 20px;font-size: 24px;border: 1px solid #ddd;">
							<el-col :span="3" style="padding: 15px 0;">
								<span style="font-family: '宋体';">审批意见</span>
							</el-col>
							<el-col :span="20" style="padding: 15px 0 15px 2%;border-left: 1px solid #ddd;">
								<!--<pre><span>{{ approvalShi.publishMsg }}</span></pre>-->
								<span v-html="approvalShi.publishMsg"></span>
							</el-col>
						</el-row>
						<el-row style="font-size: 23px;">
							<el-col>
								<el-form-item label="" prop="enclosure" style="font-size: 18px;">
									<!--<el-input v-model="gonggao.enclosure" placeholder=""></el-input>-->
                                    <iframe id="newFrame" style="width:100%;" frameBorder="0" :src="link"></iframe>
								</el-form-item>
							</el-col>
						</el-row>
						<!--<el-row>
							<el-col>
								<div style="float:right;">
									<el-button type="info" size="small" style="width: 60px;height: 30px;" @click="dialogViewForm = false;clearForm();">取消</el-button>
								</div>
							</el-col>
						</el-row>-->
					</el-form>
				</el-col>
			</el-row>
		</el-dialog>

		<!-- 编辑公告---公用 -->
		<el-dialog title="" :visible.sync="dialogGongGaoForm" center fullscreen>
			<div style="margin-top: 10px;">
				<el-form :model="gonggao" :rules="rules" ref="gonggao" label-width="140px">
					<!--专家信用信息拟制公告表-->
					<el-row>
						<el-col :span="4" class="tab-title">
							拟制公告表
						</el-col>
					</el-row>
                    <el-row>
                        <el-col :span="20">
                            <el-form-item label="标题:" prop="title" label-width="120px">
                                <el-input v-model="gonggao.title"  placeholder="" maxlength="500" show-word-limit></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
						<el-col :span="20">
							<el-form-item label="发文字号:" prop="releaseNumber" label-width="120px">
								<el-input v-model="gonggao.releaseNumber" placeholder="" maxlength="500" show-word-limit></el-input>
							</el-form-item>
						</el-col>
                    </el-row>
                    <!--<el-row>
                        <el-col :span="12">
                            <el-form-item label="创建人:" prop="createUser" style="position: relative;">
                                <el-input v-model="gonggao.createUser" placeholder=""></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>-->
                    <el-row>
                        <el-col :span="8">
                            <el-form-item label="公布类别:" prop="isPublic" label-width="120px">
                                <el-radio-group v-model="gonggao.isPublic" style="width: 400px;">
                                    <el-radio label="0">公示通报</el-radio>
                                    <el-radio label="1">标准规范</el-radio>
                                </el-radio-group>
                            </el-form-item>
                        </el-col>
						<el-col :span="8">
							<el-form-item label="法律法规类别:" prop="lawsType" label-width="120px">
								<el-input v-model="gonggao.lawsType"  placeholder="" maxlength="50" show-word-limit></el-input>
							</el-form-item>
						</el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="8">
                            <el-form-item label="公开地址类型:" prop="publicType" label-width="120px">
                                <el-select v-model="gonggao.publicType"  placeholder="请选择公开地址类型" style="width: 400px;">
                                    <el-option label="服务门户" value="0"></el-option>
                                    <el-option label="工作门户" value="1"></el-option>
                                    <el-option label="服务门户和工作门户" value="2"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="公开状态:" prop="publicState" label-width="120px">
                                <el-select v-model="gonggao.publicState"  placeholder="请选择公开状态" style="width: 400px;">
                                    <el-option label="不公开" value="0"></el-option>
                                    <el-option label="公开" value="1"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="8">
                            <el-form-item label="施行日期:" prop="dateImplementation" label-width="120px">
                                <el-date-picker type="date" v-model="gonggao.dateImplementation"  placeholder="请选择施行日期">
                                </el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="关键字:" prop="keyword" label-width="120px">
                                <el-input v-model="gonggao.keyword" placeholder="" maxlength="50" show-word-limit></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
					<el-row style="margin: 0 0 20px;">
						<el-col :span="20">
							<el-form-item label="内容:" prop="attachContent" label-width="120px">
							<el-input
								type="textarea"
								:autosize="{ minRows: 8, maxRows: 8}"
								:disabled="formDisabled"
								placeholder="请输入附加内容"
								maxlength="1000"
								show-word-limit
								v-model="gonggao.attachContent">
							</el-input>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row style="font-size: 23px;">
						<el-col>
							<el-form-item label="附件:" prop="enclosure">
								<!--<el-input v-model="gonggao.enclosure" placeholder=""></el-input>-->
								<iframe id="newFrame" style="width: 100%;height:200px;" frameBorder="0" :src="link"></iframe>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22">
							<div style="float:right;">
								<el-button type="primary" size="small" style="width: 60px;height: 30px;" @click="onReplace()">保存</el-button>
								<el-button type="info" size="small" style="width: 60px;height: 30px;" @click="dialogGongGaoForm = false;clearForm()">取消</el-button>
							</div>
						</el-col>
					</el-row>
				</el-form>
			</div>
		</el-dialog>

		<!-- 查看公告---公用 -->
		<el-dialog title="" :visible.sync="dialogGongGaoViewForm" class="index_dialog" center fullscreen>
			<el-row v-show="showApprovalBtn">
				<el-col :offset="2">
					<el-button type="warning" size="mini" @click="dialogApprovalForm=true;">审批</el-button>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="16" :offset="4">
					<div style="margin-top: 10px;">
						<el-form :model="gonggao" :rules="rules" ref="gonggao">
							<!--公开公告信息表-->
							<el-row style="margin-bottom: 10px;">
								<el-col>
									<h4 style="margin-top: 10px;font-size: 40px;text-align: center;">{{ gonggao.title }}</h4>
								</el-col>
							</el-row>
							<el-row style="margin-bottom: 10px;padding-bottom: 10px;font-size: 24px;border-bottom: 1px solid #ddd;text-align: center;">
								<el-col :span="5">
									<span>{{ gonggao.createUser }}</span>
								</el-col>
								<el-col span="4">
									<span>{{ gonggao.inputenTime }}</span>
								</el-col>
								<el-col :span="6">
									<div style="float:right;">
										<span v-if="(gonggao.publicType == 0) ? true : false">服务门户</span>
										<span v-if="(gonggao.publicType == 1) ? true : false">工作门户</span>
										<span v-if="(gonggao.publicType == 2) ? true : false">服务门户和工作门户</span>
									</div>
								</el-col>
								<el-col :span="4">
									<div style="float:right;">
										<span v-if="(gonggao.publicState == 0) ? true : false">未公开</span>
										<span v-if="(gonggao.publicState != 0) ? true : false">公开</span>
									</div>
								</el-col>
                                <el-col :span="5">
                                    <div style="float:right;">
                                        <span v-if="(gonggao.isPublic == 0) ? true : false">公示通报</span>
                                        <span v-if="(gonggao.isPublic == 1) ? true : false">标准规范</span>
                                    </div>
                                </el-col>
							</el-row>
							<el-row style="margin: 40px 0;font-size: 24px;">
								<el-col>
									<!--{{ gonggao.attachContent }}-->
									<span v-html="gonggao.attachContent"></span>
								</el-col>
							</el-row>
							<el-row v-if="approvalShi.publishMsg != '' && approvalShi.publishMsg != null" style="margin: 20px 0;padding: 0 20px;font-size: 24px;border: 1px solid #ddd;">
								<el-col :span="20" style="padding: 15px 0;">
									<span style="font-family: '宋体';">审批意见：</span>
								</el-col>
								<el-col :span="20"  style="padding: 15px 0 15px 2%;border-left: 1px solid #ddd;">
									<!--<pre><span>{{ approvalShi.publishMsg }}</span></pre>-->
									<span v-html="approvalShi.publishMsg"></span>
								</el-col>
							</el-row>
							<el-row style="font-size: 23px;">
								<el-col>
									<el-form-item label="" prop="enclosure">
										<!--<el-input v-model="gonggao.enclosure" placeholder=""></el-input>-->
										<iframe id="newFrame" style="width: 100%;" frameBorder="0" :src="link"></iframe>
									</el-form-item>
								</el-col>
							</el-row>
						</el-form>
					</div>
				</el-col>
			</el-row>
		</el-dialog>

		<!-- 审批页面 -->
		<el-dialog title="" :visible.sync="dialogApprovalForm" center>
			<div>
				<el-form :model="approvalShi" :rules="approvalRules" ref="approvalShi" label-width="140px">
					<!--公开公告审批界面-->
					<el-row>
						<el-col :span="10" class="tab-title">
							公开公告审批界面
						</el-col>
					</el-row>
					<el-row class="expertcredit_publicstate">
						<el-col>
							<el-form-item label="审批状态:" prop="publishType" label-width="120px">
								<el-radio-group v-model="approvalShi.publishType">
									<el-radio :label="1">通过</el-radio>
									<el-radio :label="0">不通过</el-radio>
								</el-radio-group>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row style="margin: 0 0 20px;">
						<el-col :span="2" class="tab" style="padding-right: 12px;width: 120px;text-align: right;height: 30px;line-height: 30px;">
							<span>审批意见:</span>
						</el-col>
						<el-col :span="18">
							<el-input
									type="textarea"
									:autosize="{ minRows: 8, maxRows: 8}"
									placeholder="请输入审批意见"
									maxlength="300"
									show-word-limit
									v-model="approvalShi.publishMsg">
							</el-input>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22">
							<div style="float:right;">
								<el-button type="primary" size="small" style="width: 60px;height: 30px;" @click="approvalList()">保存</el-button>
								<el-button type="info" size="small" style="width: 60px;height: 30px;" @click="approvalCancel()">取消</el-button>
							</div>
						</el-col>
					</el-row>
				</el-form>
			</div>
		</el-dialog>
	</div>
</div>
<script>
    var vm = new Vue({
        el: '#gonggao',
		created(){
            var userInfo = JSON.parse(localStorage.getItem('userInfo'));
            var userRole = userInfo.role;
            if(userRole.includes("地震部门审定人员")){
                this.hasApprovalBtn = true;
			}
		},
        data() {
            return {
                hasApprovalBtn: false,
                uuid:'',
                link:'', // 附件iframe
                currentPage: 1, //默认显示页面为1
                pagesize: 10, // 每页的数据条数
                tableTotal:'',
                gonggao: {
                    publicId: '',// 表单id
                    title: '',
                    createUser: '',
                    inputenTime: '',
                    content: '',
                    publicType: '',
                    publicState: '',
                    enclosure: '',
                    attachContent: '',
                    publishMsg:'',
					isPublic : '',
                    dateImplementation:'',
					lawsType:'',
					releaseNumber:'',
					keyword:''
                },
                rules: {
                    dateImplementation: [{
                        required: true,
                        message: '请选择施行日期',
                        trigger: 'blur'
                    }],
                    releaseNumber: [{
                        required: true,
                        message: '请输入发文字号',
                        trigger: 'blur'
                    }],
                    lawsType: [{
                        required: true,
                        message: '请输入法律法规类别',
                        trigger: 'blur'
                    }],
                    title: [{
                        required: true,
                        message: '请输入标题',
                        trigger: 'blur'
                    }],
                    createUser: [{
                        required: true,
                        message: '请输入创建人',
                        trigger: 'blur'
                    }],
                    inputenTime: [{
                        required: false,
                        message: '',
                        trigger: 'blur'
                    }],
                    attachContent: [{
                        required: true,
                        message: '请输入内容',
                        trigger: 'blur'
                    }],
                    publicType: [{
                        required: true,
                        message: '请输入公开地址类型',
                        trigger: 'blur'
                    }],
                    publicState: [{
                        required: true,
                        message: '请输入公共状态',
                        trigger: 'blur'
                    }],
                    enclosure: [{
                        required: false,
                        message: '',
                        trigger: 'blur'
                    }],
                    isPublic : [{
                        required : true,
						message : '请选择发布类别',
						trigger: 'blur'
					}]
                },
				// 审批
                approvalShi: {
                    publicId: '', // 表单id
                    publishType: '',
                    publishMsg: ''
				},
                approvalRules: {
                    publishType: [{
                        required: true,
                        message: '请选择审批状态',
                        trigger: 'blur'
                    }]
				},
                fileList: [], // 附件
                dialogForm: false,
                dialogViewForm: false,
                dialogGongGaoForm: false,
                dialogGongGaoViewForm: false,
                dialogApprovalForm: false,
                showApprovalBtn: false,
                selectForm: {
                    title: '',
                    createUser: '',
                    inputenTime: '',
                    publicType: '',
                    publicState: ''
                },
                companyInformation: [],
                currentRow: null,
                tableData: [],
                showOnSubmit: true,
                showOnReplace: false,
                showMoveInList: false,
                showMoveOutList: false
            }
        },
        mounted(){
            this.getData();
        },
        methods: {
            getData() {
                var pagesize = this.pagesize;
                var pageno = this.currentPage;

                axios({
                    method: 'get',
                    url: '/dzjap/publick/getAllPublick',
                    params: {
                        pageSize: pagesize,
                        pageNo: pageno,
                    }
                })
                .then(response => {
                    let data = response.data;
                    if (data.code == 200) {
						this.tableTotal = data.data.total;// 数据长度

                        this.tableData = data.data.results;
                        // 修改日期格式
                        for(let i=0;i < data.data.results.length;i++){
                            this.tableData[i].inputenTime = this.tableData[i].inputenTime.toString().substr(0,10);
                        }
					} else {
						this.$message.error(data.msg);
					}
				})
				.catch(function (error) {
					console.log(error);
				});
            },
            //获取UUID的方法
            getUuid() {
                axios({
                    method: 'get',
                    url: '/dzjap/uuid/getUuid',
                })
				.then(response => {
					if (response.data.code == 200) {
						this.uuid = response.data.data;
						this.link="../upload/annex.html?uuid="+this.uuid+"&flag=1";
					} else {
						this.$message.error(response.data.msg);
					}
				})
				.catch(function (error) {
                    console.log(error);
                });
            },

            // 表单提交
            onSubmit() {
                this.$refs['gonggao'].validate((valid) => {
                    if (valid) {
                        this.gonggao.publicId = this.uuid;
                        this.gonggao.attachContent = this.gonggao.attachContent.replace(/[\n\r]/g, '<br/>');
                        axios({
                            method: 'post',
                            url: '/dzjap/publick/addPublick',
                            data: this.gonggao
                        })
                            .then((response) => {
                                let data = response.data;
                                if (data.code == 200) {
                                    this.clearForm();
                                    this.dialogForm = false;
                                    this.$message({
                                        type: 'success',
                                        message: '添加成功!'
                                    });
                                    this.getData();
                                } else {
                                    this.$message.error(data.msg);
                                    this.gonggao.attachContent = this.gonggao.attachContent.replace(/<br\/>/g, '\n');
                                }
                            });
                    }
                })
            },
            // 表单修改
            onReplace(){
                this.$refs['gonggao'].validate((valid) => {
                    if (valid) {
                        this.gonggao.attachContent = this.gonggao.attachContent.replace(/[\n\r]/g, '<br/>');
                        this.gonggao.publishMsg = '';
                        axios({
                            method: 'post',
                            url: '/dzjap/publick/updatePublick',
                            data: this.gonggao
                        })
                            .then((response) => {
                                let data = response.data;
                                if (data.code == 200) {
                                    this.dialogForm = false;
                                    this.dialogGongGaoForm = false;

                                    this.$message({
                                        type: 'success',
                                        message: '修改成功!'
                                    });
                                    this.getData();
                                } else {
                                    this.$message.error(data.msg);
                                }
                            });
                    }
                });
            },
			//撤销
            revoke(index,row){
                axios({
                    method: 'post',
                    url: '/dzjap/publick/updateRePublick',
                    data: row
                })
				.then((response) => {
					let data = response.data;
					if (data.code == 200) {
						this.$message({
							type: 'success',
							message: '撤销成功!'
						});
						this.getData();
					} else {
						this.$message.error(data.msg);
					}
				});
			},
            clearForm(){
                this.gonggao.title = '';
                this.gonggao.createUser = '';
                this.gonggao.inputenTime = '';
                this.gonggao.content = '';
                this.gonggao.attachContent = '';
                this.gonggao.publicType = '';
                this.gonggao.publicState = '';
                this.gonggao.enclosure = '';
                this.gonggao.isPublic = '';
                this.gonggao.dateImplementation = '';
                this.gonggao.lawsType = '';
                this.gonggao.releaseNumber = '';
                this.gonggao.keyword = '';
                this.approvalShi.publishMsg = '';
            },
			// 审批置空
			clearApproval(){
                this.approvalShi.publicId = '';
                this.approvalShi.publishType = '';
                this.approvalShi.publishMsg = '';
			},
            // 上传附件
            handleChange(file, fileList) {
		        this.fileList = fileList.slice(-3);
	      	},
            apply(){
                this.dialogForm = true;
                this.showOnSubmit = true;
                this.showOnReplace = false;
                this.clearForm();
                this.getUuid();
            },
            /* 单选搜索表单 */
            selectCurrentChange(val){
                this.currentRow = val;
            },
            /* 列表页搜索 */
            searchForm() {
                var pagesize = this.pagesize;
                var pageno = this.currentPage;
                axios({
                    method: 'get',
                    url: '/dzjap/publick/getAllConPublick',
                    params: {
                        pageSize: pagesize,
                        pageNo: pageno,
                        title: this.selectForm.title,
	                    createUser: this.selectForm.createUser,
	                    inputenTime: this.selectForm.inputenTime,
	                    publicType: this.selectForm.publicType,
	                    publicState: this.selectForm.publicState
                    }
                })
                .then(response => {
                    let data = response.data;
                    if (data.code == 200) {
                        let dataInformation = response.data.data.results;
                        this.tableTotal = response.data.data.total;// 数据长度

                        this.tableData = dataInformation;
                    } else {
                        this.$message.error(data.msg);
                    }
                })
                .catch(function (error) {
                    console.log(error);
                });
            },
            /* 列表页重置 */
            resetForm(formName) {
                this.selectForm.title = '';
	            this.selectForm.createUser = '';
	            this.selectForm.inputenTime = '';
	            this.selectForm.publicType = '';
	            this.selectForm.publicState = '';
           		/*this.$nextTick(() => {
               		this.$refs['selectForm'].resetField();
               	})*/

                this.getData();
            },
            //每页下拉显示数据
            handleSizeChange(size) {
                this.pagesize = size;
                this.getData();
            },
            //点击第几页
            handleCurrentChange(currentPage) {
                this.currentPage = currentPage;
                this.getData();
            },
            // 设置允许填写和不允许填写
            checkDisabled(n){
                if(n){
                    this.formDisabled = true;
                }else{
                    this.formDisabled = false;
                }
            },
            // 删除
            del(index,row){
                var publicId = row.publicId;

                this.$confirm('确定要删除吗?', '提示', {
                    cancelButtonText: '取消',
                    confirmButtonText: '确定',
                    type: 'warning'
                }).then(() => {
                    axios({
                        method: 'post',
                        url: '/dzjap/publick/deletePublick',
                        params: {
                            publicId:publicId
                        }
                    })
                    .then(response => {
                        let data = response.data;
                        if (data.code == 200) {
                            // 确认删除
                            this.$message({
                                type: 'success',
                                message: '删除成功!'
                            });
                            this.getData();
                        } else {
                            this.$message.error(data.msg);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '取消删除'
                    });
                });
            },
			// 审批
			approvalList(){
                this.approvalShi.publishMsg = this.approvalShi.publishMsg.replace(/[\n\r]/g,'<br/>');
                axios({
                    method: 'post',
                    url: '/dzjap/publick/approvalPublick',
                    data: this.approvalShi
                })
				.then(response => {
                    let data = response.data;

					if (data.code == 200) {
						let rowdata = data.data;

                        this.dialogApprovalForm = false;
                        this.dialogViewForm = false;
                        this.dialogGongGaoViewForm = false;
                        this.clearForm();
                        this.$message({
                            type: 'success',
                            message: '审批完成!'
                        });
                        this.getData();
                        this.clearApproval();
					} else {
						this.$message.error(data.msg);
                        this.approvalShi.publishMsg = this.approvalShi.publishMsg.replace(/<br\/>/g, '\n');
					}
				})
				.catch(function (error) {
                    console.log(error);
                });
			},
			// 审批取消
			approvalCancel(){
                this.dialogApprovalForm=false;
                this.approvalShi.publishMsg='';
                this.approvalShi.publishType='';
			},
            // 查看
            view(index,row){
                this.uuid = row.publicId;
                this.showOnReplace = false;
                this.showOnSubmit = false;
                this.link="../upload/annex.html?uuid="+this.uuid+"&flag=0";
				axios({
					method: 'get',
					url: '/dzjap/publick/getPublick',
					params: {
						publicId: row.publicId
					}
				})
				.then(response => {
					let data = response.data;

					if (data.code == 200) {
						let rowdata = data.data;
						this.clearForm(); // 重置

						let type = rowdata.fictionType;
						if(type == 0){
						    // 公开公告
							this.dialogViewForm = true;
						}else{
						    // 外部生成
						    this.dialogGongGaoViewForm = true;
						}
                        this.approvalShi.publishMsg = rowdata.publishMsg;

                        this.gonggao = rowdata;
						// 申请  表单id
                        if(this.showApprovalBtn){
                            this.approvalShi.publicId = rowdata.publicId;
                        }
						// 修改日期格式
						this.gonggao.inputenTime = this.gonggao.inputenTime.toString().substr(0,10);
					} else {
						this.$message.error(data.msg);
					}
				})
				.catch(function (error) {
					console.log(error);
				});

                this.checkDisabled(true);
            },
            // 修改
            edit(index,row){
                this.showOnReplace = true;
                this.showOnSubmit = false;
                this.uuid = row.publicId;
                this.link="../upload/annex.html?uuid="+this.uuid+"&falg=1";
                axios({
                    method: 'get',
                    url: '/dzjap/publick/getPublick',
                    params: {
                        publicId: row.publicId
                    }
                })
				.then(response => {
					let data = response.data;

					if (data.code == 200) {
						let rowdata = data.data;
						this.clearForm(); // 重置

                        let type = rowdata.fictionType;
                        if(type == 0){
                            // 公开公告
                            this.dialogForm = true;
                        }else{
							// 外部生成
                            this.dialogGongGaoForm = true;
                        }
                        rowdata.attachContent = rowdata.attachContent.replace(/<br\/>/g, '\n');

                        this.gonggao = rowdata;
                        // 修改日期格式
                        this.gonggao.inputenTime = this.gonggao.inputenTime.toString().substr(0,10);
					} else {
						this.$message.error(data.msg);
					}
				})
				.catch(function (error) {
					console.log(error);
				});

                this.checkDisabled(false);
            }
        }
    })
</script>
</body>
</html>